package com.li.strategypattern;

/**
 * 环境类(Context)
 *
 * @author lirenchun
 */
public class Tourist {
    //策略接口
    private AbstractTravelWay abstractTravelWay;

    public void setTouristTravelWay(AbstractTravelWay abstractTravelWay) {
        this.abstractTravelWay = abstractTravelWay;
    }

    public AbstractTravelWay getAbstractTravelWay() {
        return abstractTravelWay;
    }


    public static void main(String[] args) {
        Tourist tourist = new Tourist();
        tourist.setTouristTravelWay(new AirplaneWay());
        System.out.println(tourist.getAbstractTravelWay().travelWay());
    }
}
